package org.istt.domain;

import static javax.persistence.GenerationType.IDENTITY;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * File entity. @author MyEclipse Persistence Tools
 */
@Entity(name = "fileAttachment")
@Table(name = "TBL_FILE_ATTACHMENT", schema = "dbo", catalog = "onegate")
public class FileAttachment extends BaseObject<Long> implements
		java.io.Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -1392103101254166475L;
	private Long id;
	private String url;
	private String fileName;
	private FileCapPhepXayDung fileCapPhepXayDung;
	private FileGiaHanCPXD fileGiaHanCPXD;
	private FileDieuChinhGPXD fileDieuChinhGPXD;
	private FileCapCCHN fileCapCCHN;
	private FileCapLaiCCHN fileCapLaiCCHN;
	private FileBoSungCCHN fileBoSungCCHN;
	private FileCapCCMGBDS fileCapCCMGBDS; 
	
	
	@ManyToOne(cascade=CascadeType.ALL, fetch=FetchType.LAZY)
	@JoinColumn(name="CAPGPXD_ID")
	public FileCapPhepXayDung getFileCapPhepXayDung() {
		return fileCapPhepXayDung;
	}

	public void setFileCapPhepXayDung(FileCapPhepXayDung fileCapPhepXayDung) {
		this.fileCapPhepXayDung = fileCapPhepXayDung;
	}

	@Column(name = "URL")
	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}
	
	@Column(name = "FILE_NAME")
	public String getFileName() {
		return fileName;
	}

	public void setFileName(String fileName) {
		this.fileName = fileName;
	}


	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "ID", unique = true, nullable = false)
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@Override
	public String toString() {
		
		return null;
	}

	@Override
	public boolean equals(Object o) {
		
		return false;
	}

	@Override
	public int hashCode() {
		
		return 0;
	}

	public void setFileCapCCHN(FileCapCCHN fileCapCCHN) {
		this.fileCapCCHN = fileCapCCHN;
	}
	
	@ManyToOne(cascade=CascadeType.ALL, fetch=FetchType.LAZY)
	@JoinColumn(name="CAP_CCHN_ID")
	public FileCapCCHN getFileCapCCHN() {
		return fileCapCCHN;
	}

	public void setFileCapLaiCCHN(FileCapLaiCCHN fileCapLaiCCHN) {
		this.fileCapLaiCCHN = fileCapLaiCCHN;
	}

	@ManyToOne(cascade=CascadeType.ALL, fetch=FetchType.LAZY)
	@JoinColumn(name="CAPLAI_CCHN_ID")
	public FileCapLaiCCHN getFileCapLaiCCHN() {
		return fileCapLaiCCHN;
	}

	public void setFileBoSungCCHN(FileBoSungCCHN fileBoSungCCHN) {
		this.fileBoSungCCHN = fileBoSungCCHN;
	}

	@ManyToOne(cascade=CascadeType.ALL, fetch=FetchType.LAZY)
	@JoinColumn(name="BOSUNG_CCHN_ID")
	public FileBoSungCCHN getFileBoSungCCHN() {
		return fileBoSungCCHN;
	}

	public void setFileGiaHanCPXD(FileGiaHanCPXD fileGiaHanCPXD) {
		this.fileGiaHanCPXD = fileGiaHanCPXD;
	}
	@ManyToOne(cascade=CascadeType.ALL, fetch=FetchType.LAZY)
	@JoinColumn(name="GIAHAN_GPXD_ID")
	public FileGiaHanCPXD getFileGiaHanCPXD() {
		return fileGiaHanCPXD;
	}

	public void setFileDieuChinhGPXD(FileDieuChinhGPXD fileDieuChinhGPXD) {
		this.fileDieuChinhGPXD = fileDieuChinhGPXD;
	}

	@ManyToOne(cascade=CascadeType.ALL, fetch=FetchType.LAZY)
	@JoinColumn(name="DIEUCHINH_GPXD_ID")
	public FileDieuChinhGPXD getFileDieuChinhGPXD() {
		return fileDieuChinhGPXD;
	}

	public void setFileCapCCMGBDS(FileCapCCMGBDS fileCapCCMGBDS) {
		this.fileCapCCMGBDS = fileCapCCMGBDS;
	}
	@ManyToOne(cascade=CascadeType.ALL, fetch=FetchType.LAZY)
	@JoinColumn(name="CAP_CCMGBDS_ID")
	public FileCapCCMGBDS getFileCapCCMGBDS() {
		return fileCapCCMGBDS;
	}

}